import { RouteRecordRaw } from "vue-router"
import Layout from "@/layout/Index.vue"

export const RootRoute: RouteRecordRaw = {
    path: "/",
    name: "Root",
    redirect: "/dashboard",
    component: Layout,
    children: [
        {
            path: "/profile",
            name: "Profile",
            component: () => import("@/views/ucenter/profile/Index.vue"),
            meta: {
                title: "个人设置",
                needLogin: true
            }
        }
    ]
}

export const LoginRoute: RouteRecordRaw = {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login/Index.vue"),
    meta: {
        title: "登录"
    }
}

// export const ErrorPageRoute: RouteRecordRaw = {
//     path: "/:path(.*)*",
//     name: "ErrorPage",
//     component: Layout,
//     children: [
//         {
//             path: "/:path(.*)*",
//             name: "ErrorPageSon",
//             component: ErrorPage,
//             meta: {
//                 title: "ErrorPage",
//                 hideBreadcrumb: true
//             }
//         }
//     ]
// }

export const RedirectRoute: RouteRecordRaw = {
    path: "/redirect",
    name: "Redirect",
    component: Layout,
    meta: {
        title: "跳转",
        hideBreadcrumb: true
    },
    children: [
        {
            path: "/redirect/:path(.*)",
            name: "Redirect",
            component: () => import("@/views/base/Redirect.vue"),
            meta: {
                title: "跳转",
                hideBreadcrumb: true
            }
        }
    ]
}

export const staticRouter: RouteRecordRaw[] = [LoginRoute, RootRoute, RedirectRoute]
